package com.itheima;

import java.text.ParseException;
import java.util.Scanner;

public class TryCatch {//try catch代码练习
    public static void main(String[] args) {
        System.out.println("请输入一个数字");
        String s =new Scanner(System.in).nextLine();
        try{
            int i = Integer.parseInt(s);
            System.out.println(i);
        }catch(Exception e){
            System.out.println("你输入的数字有误");
        }
    }
}
